package name.sakanacatcher.repository;

import name.sakanacatcher.entity.Role;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface RoleRepository extends JpaRepository<Role, Integer> {

    Role getRoleById(int id);

    void deleteById(int id);

    @Query(value = "select * from user_roles", nativeQuery = true)
    List<Map<String,Object>> getUseRoleTable();

}
